home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
cstdio.arc
/
SRC.ARC
/
MSFTF.A
< prev
next >
Wrap
Text File
|
1985-05-17
|
1KB
|
62 lines
; msftf.a - file time functions.
; (C) Copyright 1984, 1985 Gregory R. Mansfield - All Rights Reserved
; G. R. Mansfield. 84/10/28.
; Ver 1.0-5517.
include "include/msdos.ah"
cseg
public mspft_
public mssft_
; long mspft() /* pack file time */
mspft_:
mov ah,FR_GDT ; get date
int I_FCN
sub cx,1980
mov ch,cl ; year to 9 - 15
shl ch,1
mov bl,dh ; month to 5 - 8
mov bh,0
mov cl,5
shl bx,cl
or bh,ch
or bl,dl ; day to 0 - 4
push bx
mov ah,FR_GTM ; get time
int I_FCN
mov al,cl ; minute to 5 - 10
cbw
mov cl,5
shl ax,cl
shl ch,1 ; hour to 11 - 15
shl ch,1
shl ch,1
or ah,ch
shr dh,1 ; second / 2 to 0 - 4
or al,dh
pop dx
ret
; long mssft(fd, tm) /* set file time */
; int fd;
; long tm;
mssft_:
mov bx,sp ; time and date
mov cx,[bx+4]
mov dx,[bx+6]
mov bx,[bx+2] ; file handle
mov al,1 ; set date and time
mov ah,FR_FDT ; file date/time
xor si,si
int I_FCN
jnc sft1 ; no error
dec si
sft1: mov ax,si
ret